package com.honey.mybatis.generator.condition.method;

import com.honey.compilation.java.Clazz;
import com.honey.compilation.java.JavaKeyWord;
import com.honey.core.dbmapping.introspect.IntrospectSchema;
import com.honey.core.dbmapping.introspect.IntrospectSchemaColumn;
import com.honey.core.types.FullyQualifiedJavaType;
import com.honey.mybatis.generator.AbstractMethod;
import com.honey.mybatis.generator.MybatisPlugin;
import com.honey.mybatis.generator.condition.ConditionConstant;

/**
 * getOredCriteria 函数
 * @author Administrator
 *
 */
public class GetOredCriteriaMethod extends AbstractMethod {
	
	public GetOredCriteriaMethod(){
	}
	public GetOredCriteriaMethod(Clazz clazz, MybatisPlugin belongPlugin,
			IntrospectSchema introspectSchema,
			IntrospectSchemaColumn introspectSchemaColumn) {
		super(clazz, belongPlugin, introspectSchema, introspectSchemaColumn);
	}
	/** 方法名称 */
	private static final String METHOD_NAME ="getOredCriteria";
	
	/** 返回参数类型 */
	private static final  FullyQualifiedJavaType returnType = new FullyQualifiedJavaType("java.util.List<T>");
	
	/** 方法体 */
	private static final String[] METHOD_BODY =new String[]{
		JavaKeyWord.RETURN + JavaKeyWord.OPERATION_THIS.toString() + ConditionConstant.ORED_CRITERIA
	};

	/** 方法注释 */
	private static final String[] JAVA_DOC = new String []{
		"获取排序列。"
	};
	
	/*
	 * (non-Javadoc)
	 * @see com.honey.mybatis.generator.AbstractMethod#getMethodName()
	 */
	@Override
	protected String getMethodName() {
		return METHOD_NAME;
	}
	
	/*
	 * (non-Javadoc)
	 * @see com.honey.mybatis.generator.AbstractMethod#getBody()
	 */
	@Override
	protected String[] getBody() {
		return METHOD_BODY;
	}

	/*
	 * (non-Javadoc)
	 * @see com.honey.mybatis.generator.AbstractMethod#getJavaDoc()
	 */
	@Override
	protected String[] getJavaDoc() {
		return JAVA_DOC;
	}
	
	/*
	 * (non-Javadoc)
	 * @see com.honey.mybatis.generator.AbstractMethod#getReturnType()
	 */
	@Override
	protected FullyQualifiedJavaType getReturnType() {

		return returnType;
	}
	
	public static void main(String []args){
		GetOredCriteriaMethod  cm = new GetOredCriteriaMethod();
		System.out.println(cm.createMethod().compiledContent(0)); 
	}
	
}
